package com.weayer.util;

/**
 * @description: Redis 前缀
 * @author: Weayer
 **/
public class RedisPrefixUtils {

    // 乘客验证码前缀
    public static String verificationCodePrefix = "verification-code-";

    // token 前缀
    public static String tokenPrefix = "token-";

    // 设备号黑名单前缀
    public static String blackDeviceCodePrefix = "black-device-";

    /**
     * @Description: 验证码key
     * @Param: [passengerPhone]
     * @return: java.lang.String
     **/
    public static String generatorKeyByPhone(String phone, String identity){
        return verificationCodePrefix + identity + "-" + phone;
    }

    /**
     * @Description: 根据手机号和身份标识，生成token
     * @Param: [phone, identify, tokenType]
     * @return: java.lang.String
     **/
    public static String generatorTokenKey(String phone, String identify, String tokenType){
        return tokenPrefix + phone + "-" + identify + "-" + tokenType;
    }
}
